package com.haha.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.validation.*;
import javax.validation.constraints.*;
import java.awt.*;
import java.io.Serializable;
import java.util.Date;

import com.haha.common.valid.AddGroup;
import com.haha.common.valid.EditGroup;
import com.haha.common.valid.ListValue;
import lombok.Data;
import org.checkerframework.checker.signature.qual.BinaryNameOrPrimitiveType;
import org.hibernate.validator.constraints.URL;

/**
 * 品牌
 * 
 * @author xiongweizhong
 * @email xiongwei@gmail.com
 * @date 2022-06-22 23:36:06
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@NotNull(message = "修改的时候必须携带id",groups = {EditGroup.class})
	@Null(message = "添加的时候不可携带id",groups = {AddGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名这个参数不可为空",groups = {AddGroup.class,EditGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotNull(message = "添加的时候必须传Url")
	@URL(message = "logo地址必须是个合法url地址",groups = {AddGroup.class,EditGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	//@NotNull(message = "showStatus不可为空")
	@ListValue(vals={0,1},groups = {AddGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotNull(message = "需要填写检索首字母")
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是一个字母")
	private String firstLetter;
	/**
	 * 排序
	 */
	@Min(value = 0,message = "最小为0")
	@Max(value = 1,message = "最大的为1")
	private Integer sort;

}
